#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pi;
int solve() {
  int n,x; cin>>n>>x;
  vector<pi> v(n);
  for(int i=0;i<n;++i) {
    auto&[val,idx] = v[i];
    cin>>val;
    idx=i+1;
  }
  sort(v.begin(),v.end(),
      [](pi p1,pi p2){return p1.first>p2.first;});
  bool found = false;
  for(auto it=v.cbegin(),ed=v.cend()-1; it!=ed; ) {
    auto &a=it->first,&b=ed->first;
    if(a+b>x) {
      ++it;
    } else if(a+b<x) {
      --ed;
    } else {
      found = true;
      cout << it->second<<" "<<ed->second<<"\n";
      break;
    }
  }
  if(!found)cout << "IMPOSSIBLE\n";

  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  // freopen("in.txt","r",stdin);
  // freopen("out.txt","w",stdout);
  int tc; tc = 1;
  for(int t = 1; t <= tc; t++) {
    // cout << "Case #" << t << ": "
    solve();
  }
  return 0;
}
